import { defineStore } from 'pinia'
import { useRouteStore } from './routeStore'
import { useRoute } from 'vue-router'
export const useMenuStore = defineStore('menuStore', {
  state: () => ({
    path: '/index',
  }),
  getters: {
    // 从路由列表获取的所有菜单信息
    menus() {
      const routeStore = useRouteStore()
      return routeStore.routes
    },
  },
  actions: {
    //  设置当前选中的菜单
    setActiveMenu(path: string) {
      this.path = path
    },
  },
})
